<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>TODO supply a title</title>
    </head>
    <body>
        <h:form>
             <p:growl id="msgs" showDetail="true"/>  
            <p:panel header="Double Combo" style="margin-bottom:10px;">
                <h:panelGrid columns="2" cellpadding="5">
                    <p:selectOneMenu id="city" value="#{addVehicle.city}">
                        <f:selectItem itemLabel="Select City" itemValue="" />
                        <f:selectItems value="#{addVehicle.cities}" />
                        <p:ajax update="suburbs"
                                listener="#{addVehicle.handleCityChange}" />
                    </p:selectOneMenu>

                    <p:selectOneMenu id="suburbs" value="#{addVehicle.suburb}">
                        <f:selectItem itemLabel="Select Suburb" itemValue="" />
                        <f:selectItems value="#{addVehicle.suburbs}" />
                    </p:selectOneMenu>
                </h:panelGrid>

                <p:separator />

                <p:commandButton value="Submit" update="msgs" actionListener="#{addVehicle.displayLocation}" id="btnSubmit"/>

            </p:panel>
        </h:form>

    </body>
</html>
